home *** CD-ROM | disk | FTP | other *** search
/ AMIGA-CD 2 / Amiga-CD - Volume 2.iso / ungepackte_daten / 1994 / 8 / 02 / tips & tricks / delicon.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-01  |  812 b   |  38 lines

  1. #include <exec/types.h>
  2. #include <exec/execbase.h>
  3. #include <dos/dos.h>
  4. #include <clib/icon_protos.h>
  5. #include <clib/exec_protos.h>
  6. #include <clib/dos_protos.h>
  7.  
  8. #include <string.h>
  9.  
  10. extern struct ExecBase *SysBase;
  11. struct Library *IconBase;
  12.  
  13. int main(int argc, char *argv[])
  14. {
  15.    int retcode = RETURN_OK;
  16.    
  17.    if (SysBase->SoftVer < 37)
  18.    {  Write(Output(),"OS 2.04 nötig\n",14);
  19.       return RETURN_FAIL;
  20.    }
  21.  
  22.    if ((argc != 2) || (strcmp(argv[1],"?")==0))
  23.    {  Printf("Aufruf: %s Dateiname/A\n",(long)argv[0]);
  24.       return RETURN_WARN;
  25.    }
  26.  
  27.    if (IconBase = OpenLibrary("icon.library",37))
  28.    {  if (!DeleteDiskObject(argv[1]))
  29.       {  /* Aktion fehlgeschlagen */
  30.          PrintFault(IoErr(),argv[0]);
  31.          retcode = RETURN_FAIL;
  32.       }
  33.       CloseLibrary(IconBase);
  34.    }
  35.  
  36.    return retcode;
  37. }
  38.